package com.pairuan.admin.controller;

import com.pairuan.common.web.controller.BaseController;
import com.pairuan.common.web.page.TableDataInfo;
import com.pairuan.service.entity.User;
import com.pairuan.service.service.UserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户管理控制器
 */
@Tag(name = "用户管理")
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController extends BaseController {

    private final UserService userService;

    /**
     * 获取用户列表
     */
    @Operation(summary = "获取用户列表")
    @GetMapping("/list")
    public TableDataInfo list() {
        startPage();
        List<User> list = userService.list();
        return getDataTable(list);
    }
} 